using System;
using System.Text;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Xml;
using System.Xml.Serialization;
using System.IO;


namespace TagFlo
{

        [Serializable]
        public class Configuration
        {
            int _Version;
            public Collection<string> IncludedDirectorys = new Collection<string>();
            public Collection<string> ExcludedDirectorys = new Collection<string>();
            public string FlickrUserId;
            public string FlickrUsername;
            public string FlickerToken;
            public int MaxEdge;


            public Configuration()
            {
                _Version = 1;
                //_exclededDirectorys = new string[1];
                //_includedDirectorys = new string[1];
                
            }
            public static void Save(string file, Configuration c)
            {
                System.Xml.Serialization.XmlSerializer xs
                   = new System.Xml.Serialization.XmlSerializer(c.GetType());
                StreamWriter writer = File.CreateText(file);
                xs.Serialize(writer, c);
                writer.Flush();
                writer.Close();
            }
            public static Configuration Load(string file)
            {
                System.Xml.Serialization.XmlSerializer xs
                   = new System.Xml.Serialization.XmlSerializer(
                      typeof(Configuration));
                StreamReader reader = File.OpenText(file);
                Configuration c = (Configuration)xs.Deserialize(reader);
                reader.Close();
                return c;
            }
            public int Version
            {
                get { return _Version; }
                set { _Version = value; }
            }
           
        }
    
}
